<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
<script type="text/javascript" src="/js/jq.js"></script>
<script type="text/javascript">
function login(){
	var username =$("#usernameId").val();
	var password =$("#passwordId").val();
	var data={"username":$("#usernameId").val(),"password":$("#passwordId").val()};
	$.ajax({
		type:'POST',
		url:'/user/login',
		data:data,
		success:function(data){
				console.log("data:"+data);
			if(data=="success"){
			   window.location.href="/successLogin";
			}else{
				alert("用户名或者密码错误");
			}
			
		}
		
	});
}
</script>
<script type="text/javascript">
$(function(){

}
)
</script>
</head>
<body>
<h1>sso server首页首页首页</h1>
用户名：<input type="text" id="usernameId" name="username" placeholder="用户名"/>
密    码： <input type="password" id="passwordId" name="username"/>
<button onclick="login()" id="loginButton">登录</button>
</body>
</html>
